#define _CRT_SECURE_NO_WARNINGS 1
#include"SeqList.h"

int main()
{
	SL sl;
	SLInit(&sl);

	while(1)
	{
		int input = 0, x = 0, pos = 0;
		input = lobby();
		switch(input)
		{
			case 1:
				printf("Please input value:>");
				scanf("%d", &x);
				SLPushBack(&sl, x);
				printf("Successed!");
				break;
			case 2:
				printf("Please input value:>");
				scanf("%d", &x);
				SLPushFront(&sl, x);
				printf("Successed!");
				break;
			case 3:
				SLPopBack(&sl);
				printf("Successed!");
				break;
			case 4:
				SLPopFront(&sl);
				printf("Successed!");
				break;
			case 5:
				printf("Please input value:>");
				scanf("%d", &x);
				printf("Please input position:>");
				scanf("%d", &pos);
				SLInsert(&sl, pos, x);
				printf("Successed!");
				break;
			case 6:
				printf("Please input position:>");
				scanf("%d", &pos);
				SLErase(&sl, pos);
				printf("Successed!");
				break;
			case 7:
				SLPrint(&sl);
				break;
			case 8:
				printf("Please input value:>");
				scanf("%d", &x);
				SLFind(&sl, x);
				break;
			case 9:
				printf("Please input a new value:>");
				scanf("%d", &x);
				printf("Please input position:>");
				scanf("%d", &pos);
				SLModify(&sl, pos, x);
				printf("Successed!");
				break;
			case 10:
				SLDestory(&sl);
				exit(0);
			default:
				printf("Invalid input\n");
		}
		printf("\n\n\n");
	}

	return 0;
}